package com.lkc.mapper;

import com.lkc.bean.Comments;
import com.lkc.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentsDao {
    int add(@Param("param") Comments comments);
    int del(@Param("id") Integer commentId);
    int edit(@Param("param") Comments comments);
    Comments one(@Param("id") Integer commentId);
    int pageCount(@Param("param") Comments comments);
    List<Comments> page(@Param("page") Page page, @Param("param") Comments comments);

    // 按商品ID查询评论
    List<Comments> findByProductId(@Param("productId") Integer productId);
    // 添加查询所有评论的方法
    List<Comments> all(@Param("param") Comments comments);


}
